﻿using System.Collections.Generic;
using System.Linq.Expressions;

namespace EOrm
{
    /// <summary>
    /// 排序条件访问器
    /// </summary>
    public abstract class OrderByVisitor
    {
        /// <summary>
        /// 排序条件存储栈
        /// </summary>
        protected Stack<string> _orderByStack = new Stack<string>();

        /// <summary>
        /// 访问表达式
        /// </summary>
        /// <param name="exp">要访问的表达式</param>
        /// <param name="table">目标表</param>
        public abstract void Visit(Expression exp, ITable table);

        /// <summary>
        /// 排序表达式合并
        /// </summary>
        /// <returns>合并结果</returns>
        public abstract string Combine();
    }
}
